home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / createPond.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  4.4 KB  |  103 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  2002
  22. //  Author:         DRB
  23. //
  24. // Description: Create a pond, or fluid with a water surface simulation
  25. //    
  26.  
  27. proc string createWaterSurfaceFluid( float $pondSize )
  28. {
  29.     create2DFluid 100 100 $pondSize $pondSize ($pondSize*.15);
  30.     string $fSel[] = `ls -sl -dag`;
  31.     string $fluid = $fSel[0];
  32.  
  33.     rename $fluid "Pond#";
  34.     $fSel = `ls -sl -dag`;
  35.     $fluid = $fSel[0];
  36.  
  37.     string $fluidShape = $fSel[1];
  38.  
  39.     setAttr ($fluid + ".rx") -90;
  40.     setAttr ($fluid + ".solver") 2;
  41.     setAttr ($fluid + ".boundaryDraw") 4;
  42.     setAttr ($fluid + ".heightField") 1;
  43.     setAttr ($fluid + ".densityScale") 1.0;
  44.     setAttr ($fluid + ".edgeDropoff") 0.008;
  45.     setAttr ($fluid + ".velocityDamp") 0.02;
  46.     setAttr ($fluid + ".transparency") -type double3 0 0 0;
  47.     setAttr ($fluid + ".specularColor") -type double3 0.95868 0.95868 0.95868;
  48.     setAttr ($fluid + ".surfaceRender") 1;
  49.     setAttr ($fluid + ".colorInput") 6;
  50.     setAttr ($fluid + ".incandescenceInput") 5;
  51.     setAttr ($fluid + ".incandescence[0].incandescence_Position") 0.3;
  52.     setAttr ($fluid + ".incandescence[1].incandescence_Color") -type double3 0.061628 0.199391 0.217;
  53.     setAttr ($fluid + ".incandescence[1].incandescence_Position") 0.5;
  54.     setAttr ($fluid + ".incandescence[1].incandescence_Interp") 1;
  55.  
  56.     setAttr ($fluid + ".incandescence[2].incandescence_Color") -type double3 0.249288 0.408 0.342373;
  57.     setAttr ($fluid + ".incandescence[2].incandescence_Position") 1.0;
  58.     setAttr ($fluid + ".incandescence[2].incandescence_Interp") 1;
  59.  
  60.     setAttr ($fluid + ".color[0].color_Color") -type double3 0.089646 0.189544 0.446;
  61.     setAttr ($fluid + ".color[1].color_Color") -type double3 0.630252 0.732 0.685213;
  62.     setAttr ($fluid + ".color[1].color_Position") 0.5;
  63.     setAttr ($fluid + ".color[1].color_Interp") 1;
  64.     setAttr ($fluid + ".color[2].color_Color") -type double3 1.0 1.0 1.0;
  65.     setAttr ($fluid + ".color[2].color_Position") 1.0;
  66.     setAttr ($fluid + ".color[2].color_Interp") 1;
  67.     setAttr ($fluid + ".environment[0].environment_Color") -type double3 0.042744 0.108427 0.548;
  68.  
  69.     setAttr ($fluid + ".environment[1].environment_Color") -type double3 0.08708 0.156017 0.28;
  70.     setAttr ($fluid + ".environment[1].environment_Position") 0.45;
  71.     setAttr ($fluid + ".environment[1].environment_Interp") 1;
  72.  
  73.     setAttr ($fluid + ".environment[2].environment_Color") -type double3 0.7905 0.93 0.871433;
  74.     setAttr ($fluid + ".environment[2].environment_Position") 0.6;
  75.     setAttr ($fluid + ".environment[2].environment_Interp") 1;
  76.  
  77.     setAttr ($fluid + ".environment[3].environment_Color") -type double3 0.140119 0.215084 0.541;
  78.     setAttr ($fluid + ".environment[3].environment_Position") 1.0;
  79.     setAttr ($fluid + ".environment[3].environment_Interp") 1;
  80.  
  81.     return( $fluidShape );
  82. }
  83.  
  84. global proc createPond( float $pondSize )
  85. {
  86.     if( !fluidEditLicenseFound() ) {    
  87.         error( "Fluid license not found." );
  88.         return;
  89.     }
  90.     string $shape = createWaterSurfaceFluid( $pondSize );
  91.     string $shapeHelp = ("This 2D fluid uses a spring mesh height model to"
  92.         +" model a water surface. One can generate wakes into it by using fluid"
  93.         +" emitters. Negative density emission will push the surface down"
  94.         +" while positive values will push the surface up. This surface"
  95.         +" renders as a raytraced volumetric surface. Waves that are larger"
  96.         +" than the vertical fluid bounds will be clipped. The size parameter"
  97.         +" can be increased to provide a larger range of travel, although the"
  98.         +" volume rendering may be a bit slower.");
  99.  
  100.     addAttr -sn nts -ln notes -dt "string" $shape;
  101.     setAttr -type "string" ($shape + ".notes") $shapeHelp;
  102. }
  103.